package com.magicsharpmod.item;

import com.magicsharpmod.MagicSharpMod;
import com.magicsharpmod.MagicSharpModClient;
import com.magicsharpmod.item.custom.Prospector;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroupEntries;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemGroups;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;

public class ModItems {
    public static final Item GUN = registerItems("gun",new Item(new FabricItemSettings()));

    public static final Item MSFIRE = registerItems("msfire",new Item(new FabricItemSettings()));

    public static final Item SHUANGCUI_LEMON_TEA = registerItems("shuangcui_lemon_tea",new Item(new FabricItemSettings().food(ModFoodComponents.SHUANGCUI_LEMON_TEA)));

    public static final Item FRIED_SHARP_MEET = registerItems("fried_sharp_meet",new Item(new FabricItemSettings().food(ModFoodComponents.FRIED_SHARP_MEET)));

    public static final Item PEE_OF_SHARP = registerItems("pee_of_sharp",new Item(new FabricItemSettings().food(ModFoodComponents.PEE_OF_SHARP)));

    public static final Item WOODS = registerItems("woods",new Item(new FabricItemSettings()));

    public static final Item PROSPECTOR = registerItems("prospector",new Prospector(new FabricItemSettings().maxDamage(64)));

    public static Item registerItems(String name,Item item) {
        return Registry.register(Registries.ITEM,new Identifier(MagicSharpMod.MOD_ID, name),item);
    }


    public static void addItemsToIG(FabricItemGroupEntries fabricItemGroupEntries){
        fabricItemGroupEntries.add(GUN);
    }

    public static void registerModItems() {
        ItemGroupEvents.modifyEntriesEvent(ItemGroups.INGREDIENTS).register(ModItems::addItemsToIG);
    }
    //最主要还是ItemGroupEvent这个物品栏事件来 不叫添加物品，叫增加物品通道。
}
